<?php
include '../../lib/global.php';
include LIB_PATH.'db/db.php';
include PUBLIC_PATH.'common/Template.php';

session_start();

/* 获取当前id的数据 */
/* 应当添加一些错误检查 */
$tableName = $_GET['type'];
$tableID = $_GET['id'];
$queryStr = sprintf('select * from %s where id=%s', $tableName, $tableID );
$query = mysql_query($queryStr, $GLOBALS['DB']);
if(!$query){
    /* 出错 */
    die("无法执行更新操作");
}
$result = mysql_fetch_array($query);
if($result==false){
    die("无法执行更新操作");
}
/* 判断是否有权限修改 */
?>
<html>
    <head>
        <meta charset="UTF-8">
        <script language="javascript" type="text/javascript" src="../js/My97DatePicker/WdatePicker.js">
        </script>
    </head>
    <body>
        <form action="" method="post">
        <center>
        <table>
            <?php
                $temp = new Template();
                switch ($tableName){
                    case 'Awards':
                        $temp->awardsTemp($result);
                        break;
                    case 'JournalThesis':
                    break;
                    case 'ConferenceThesis':
                    break;
                    case 'Patent':
                    break;
                    case 'SoftwareCopyright':
                    break;
                    case 'Project':
                    break;
                    case 'Treaties':
                    break;
            
                    default :
                        break;
                }
            ?>
            <tr>
                <td></td>
                <td><input type="submit" value="修改"/></td>
            </tr>
        </table>
        </center>
    </form>
</body>
</html>
